<!doctype html>
<html ng-app>
<head>
    <link href="media/css/bootstrap.min.css" rel="stylesheet" media="screen">
    <script src="media/js/angular.min.js"></script>
    <script>
        var TestCtrl = function($scope){
            $scope.see = function(){
                console.log($scope.test_form.$error);
            }
        }
    </script>
</head>
<body>
<div>
    <form name="test_form" ng-controller="TestCtrl">
        <input type="text" name="a" required ng-model="a"  />
        <input type="text" name="b" required ng-model="b" ng-minlength="2" />

        <span ng-click="see()">{{ test_form.$error }}</span>
    </form>

</div>
</body>
</html>